package text111;

public class Solution45 {
    public int hammingWeight(int n) {
		
		  int res = 0; 
		  while(n!=0) { 
			  if ((1&n)==1) { 
				  res++; 
			  } 
			  n>>>=1; 
			  } 
		  return res;
		 
    	//return Integer.bitCount(n);
    }
}
